<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>My JSP 'listallstudents.jsp' starting page</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<link rel="stylesheet"
			href="<%=request.getContextPath()%>/css/common.css" type="text/css" />

	</head>

	<body>
		<div id="page_container">
			<div id="page_nav">
				<span><a
					href="<%=request.getContextPath()%>/student/addstudent.jsp">添加学生</a>
				</span>
				<span><a
					href="<%=request.getContextPath()%>/student/getallstudents.action">管理学生</a>
				</span>
				<span><a
					href="<%=request.getContextPath()%>/student/searchstudent.jsp">搜索学生</a>
				</span>
				<span><a
					href="<%=request.getContextPath()%>/student/searchstudentbyconditions.jsp">高级搜索</a>
				</span>
				<span><a href="student/exportstudentstoexcel.action">导出至Excel</a>
				</span>
			</div>
			<h2>
				全部学生信息如下：
			</h2>
			<table class="table_common">
				<tr class="row_head">
					<th>
						学号
					</th>
					<th>
						姓名
					</th>
					<th>
						班级
					</th>
					<th>
						编辑
					</th>
					<th>
						删除
					</th>
				</tr>
				<tr>
					<s:iterator value="sl" status="st">
						<s:hidden name="studentid" />
						<s:hidden value="studentind" />
						<s:if test="#st.odd==true">
							<tr class="row_odd">
						</s:if>
						<s:else>
							<tr class="row_even">
						</s:else>
						<td>
							<s:property value="studentno" />
						</td>
						<td>
							<s:property value="studentname" />
						</td>
						<td>
							<s:property value="studentclass" />
						</td>
						<td>
							<a href="student/findstudentbyid.action?studentid=${studentid}"><img
									src="<%=request.getContextPath()%>/images/114.gif" /> </a>
						</td>
						<td>
							<a href="student/deletestudent.action?studentid=${studentid}"
								onclick="javascript: return window.confirm('确定删除吗?')"><img
									src="<%=request.getContextPath()%>/images/083.gif" /> </a>
						</td>
					</s:iterator>
				</tr>
			</table>
			<table>
				<tr>
					<td colspan="9">
						共
						<s:property value="totalRows" />
						条&nbsp; 第
						<s:property value="currentPage" />
						页&nbsp; 共
						<s:property value="pager.getTotalPages()" />
						页&nbsp;
						<a
							href="<s:url value="/student/getallstudents.action">
    			<s:param name="currentPage" value="currentPage"/>
    			<s:param name="pagerMethod" value="'first'"/>
    			
    		</s:url>">首页</a>
						<a
							href="<s:url value="/student/getallstudents.action">
    			<s:param name="currentPage" value="currentPage"/>
    			<s:param name="pagerMethod" value="'previous'"/>
    		</s:url>">上一页</a>
						<a
							href="<s:url value="/student/getallstudents.action">
    			<s:param name="currentPage" value="currentPage"/>
    			<s:param name="pagerMethod" value="'next'"/>
    		</s:url>">下一页</a>
						<a
							href="<s:url value="/student/getallstudents.action">
    			<s:param name="currentPage" value="currentPage"/>
    			<s:param name="pagerMethod" value="'last'"/>
    		</s:url>">尾页</a>
					</td>
				</tr>
			</table>

		</div>
	</body>
</html>
